#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
vector<int> edg[N];
int n,x,a,b,deg[N];
int nxt[N];
void dfs(int u,int f){
  nxt[f] = u;
  for(int v : edg[u]){
    if(v != f)dfs(v,u);
  }
}
namespace Sub3{
  int f[N][19];
  int vl[N],id[N],lg[N];
  int query(int l,int r){
    int k = lg[r-l+1];
    return min(f[l][k],f[r-(1<<k)+1][k]);
  }
  void work(){
    dfs(x,0);
    int u = x,cnt = 1;
    vl[u] = cnt;
    id[cnt] = u;
    lg[1] = 0;
    for(int i = 1; i <= n ; ++ i)lg[i] = lg[i>>1] + 1;
    while(nxt[u]){
      u = nxt[u];
      vl[u] = ++cnt;
      id[cnt] = u;
    }
    for(int i = 1; i <= cnt ; ++ i){
      f[i][0] = id[i];
    }
    for(int j = 1; j <= lg[n]; ++ j){
      for(int i = 1; i <= n - (1<<j) + 1 ; ++ i){
        f[i][j] = min(f[i][j-1],f[i+(1<<j-1)][j-1]);
      }
    }
    int ans = INT_MAX;
    for(int i = 1; i <= n ; ++ i){
      int l = i * a, r = i * a + (i-1) * b;
      if(l > n){
        break;
      }
      l = min(l,n), r = min(r,n);
      l -= b;
      ans = min(ans,query(l,r));
    }
    cout << ans << "\n";
  }
}
int main(){
  freopen("nim.in","r",stdin);
  freopen("nim.out","w",stdout);
  ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
  cin >> n >> x >> a >> b;
  for(int i = 1,u,v; i < n ; ++ i)cin >> u >> v,edg[u].push_back(v),edg[v].push_back(u),deg[u]++,deg[v]++;
  if(a <= b){
    cout << 1 << "\n";
    return 0;
  }else if(deg[x] == 1){
    Sub3::work();
  }else{
    cout << 1 << "\n";
  }

  return 0;
}